package com.wd.myplacard.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.wd.current.model.Bean.DataBean
import com.wd.current.model.Utils.HttpUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * 作者: 张智聪
 * 时间: 2024/10/17
Time:  16:19
 * 描述:
 */
class PlacardViewModel:ViewModel() {
    val findLeaderBoardData= MutableLiveData<DataBean.FindLeaderBoardBean>()

    //===================tab下标切换状态监听
    val tabPositionIndex=MutableLiveData<Int>()

    fun tabPosition(id:Int){
        tabPositionIndex.value=id
    }
    fun getFindLeaderBoard(){
        HttpUtils.httpUtils.aplis2.getFindLeaderBoardData()
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                findLeaderBoardData.value=it
            }
    }

}